package com.minigame.chess.gobang.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum Color {
    BLACK(1), WHITE(0),
    ;
    private final Integer code;
    public static Color ofCode(Integer code) {
        for (Color value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
